package com.ibctp.trader;

import com.ctp.socket.listener.AbstractTraderListener;

public class CTPTraderListener extends AbstractTraderListener {

	private CTPTraderProcessor traderProcessor = null;

	public void initProcessor(CTPTraderProcessor traderProcessor) {
		this.traderProcessor = traderProcessor;
	}

	public void processResult(String ret) {
		String[] params = ret.split(";");
		int method = Integer.parseInt(params[0]);

		switch (method) {
		case METHOD_FORM_CONFIRM:
			traderProcessor.confirmForm(params);
			break;
		case METHOD_BARGAIN_CONFIRM:
			traderProcessor.addBargain(params);
			break;
		default:
			break;
		}
	}

}
